<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ user.title }}</title>
    <link rel="stylesheet" href="/static/bootstrap-3.3.7-dist/css/bootstrap.css">
    <script src="/static/jQuery-3.3.1.js"></script>
    <link rel="stylesheet" href="/static/user_site.css">
</head>
<body>

<div class="container">
    <div class="row">
        <div class="header">
            <div class="col-md-2 user_title">{{ user.title }}</div>
            <div class="col-md-7"></div>
            <div class="col-md-1"><a href="{% url 'index' %}">小站点</a></div>
            <div class="col-md-1"><a href="#">新文章</a></div>
            <div class="col-md-1"><a href="#">管理</a></div>
        </div>
        <hr>

        <div class="body">
            <div class="col-md-3">
                <div class="panel panel-default">
                    <div class="panel-heading">文章分类</div>
                    <div class="panel-body">
                        {% with user.userinfo.username as  uname %}
                            {% for category in category_list %}
                                {% if category.2 >= 1 %}
                                    <p class="archive"><a
                                            href="/{{ uname }}/category/{{ category.0 }}">{{ category.1 }}({{ category.2 }})</a>
                                    </p>
                                {% endif %}
                            {% endfor %}
                        {% endwith %}
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">文章标签</div>
                    <div class="panel-body">
                        {% with user.userinfo.username as  uname %}
                            {% for tag in tag_list %}
                                {% if tag.2 >= 1 %}
                                    <p class="archive"><a
                                            href="/{{ uname }}/tag/{{ tag.0 }}">{{ tag.1 }}({{ tag.2 }})</a></p>
                                {% endif %}
                            {% endfor %}
                        {% endwith %}
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">文章归档</div>
                    <div class="panel-body">
                        {% with user.userinfo.username as  uname %}
                            {% for adl in archvie_date_list %}
                                <p class="archive"><a href="/{{ uname }}/archive/{{ adl.0|date:"Y-m" }}">{{ adl.0|date:"Y年m月" }}({{ adl.1 }})</a></p>
                            {% endfor %}
                        {% endwith %}

                    </div>
                </div>

            </div>
            <div class="col-md-9">
                {% for article in articles %}
                    <div class="media">
                        <h4>{{ article.title }}</h4>
                        <div class="media-body">
                            {{ article.content|truncatechars:100 }}...
                        </div>
                        <div class="book_read">
                            <p><a href="#">阅读全文 》 </a></p>
                        </div>
                        <div class="media-spans pull-right small">
                            <span>posted @ {{ article.create_time|date:'Y-m-d H:i:s' }}</span>
                            <span><a href="#">{{ article.blog.userinfo.username }}</a></span>
                            <span><a href="#">评论({{ article.commit_num }})</a></span>
                            <span><a href="#">点赞({{ article.up_num }})</a></span>
                            <span><a href="#">编辑</a></span>
                        </div>
                    </div>
                    <hr>
                {% endfor %}

                {% if per_list.count > 1 %}
                    {% include 'register/nav.html' %}
                {% endif %}

            </div>
        </div>
    </div>
</div>


</body>
</html>